<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="css/user/public.css">
    <link rel="stylesheet" href="css/user/index.css">
    <script language="javascript" type="text/javascript" src="js/user/jquery-1.8.3.min.js"></script>
    <script language="javascript" type="text/javascript" src="js/user/index.js"></script>
    <title>注册</title>
</head>
<body>
<!--top-->
<div class="index_top_link">
    <div class="index_top_link_box">
        <p>专注做好投融资平台</p>
    </div>
</div>
<div class="index_logo">
    <div class="index_logo_box">
        <div class="index_logo_box_left">
            <a href="index.html"><img src="images/logo.png" class="index_logo_box_left_logo"></a>
            <img src="images/logo_title_r.png">
        </div>
    </div>
</div>
<!--top-->
<!--main-->
<div class="index_main">
    <div class="index_main_box">
        <!--right-->
        <div class="register_main_right">
            <div class="register_main_right_box">
                <p class="register_ts">领投温馨提示：以下信息均为必填项，请完整填写！联系方式主要用于办理投融资手续使用，平台会泄露您的个人信息！</p>
                <form class="register_form_box">
                    <div class="register_form_cont">
                        <p class="register_form_box_ts">已有账号？<a href="login.html">直接登录</a></p>
                        <p><span>手机号：</span><input type="text" placeholder="请输入手机号码" id="register_phone"/></p>
                        <p class="register_yzm_box"><span>验证码：</span><input type="text" placeholder="请输入验证码" class="register_form_inp" id="register_yzm"/><img id="yanzhengPic"  src='lt/verifyCode.png' class='register_yzm'></p>
                        <p><span>短信验证码：</span><input type="text" placeholder="请输入验证码" class="register_form_inp" id="register_dx_yzm"/><a href="javascript:void (0)" class="new_fs">获取短信验证码</a><input type="button" id="btn" class="djs"/></p>
                        <p><span>输入密码：</span><input type="password" placeholder="请输入密码" id="register_password"/></p>
                        <p><span>再输一次：</span><input type="password" placeholder="请再输一次" id="register_passA"/></p>
                        <p class="register_form_box_tjr"><img src="images/icon_10.png"><a href="#">我有推荐人</a></p>
                        <p class="register_form_box_id"><span>推荐人ID号：</span><input type="text" placeholder="请输入推荐人信息" id="register_tj_id"/></p>
                        <p class="register_form_box_tjr1"><input type="checkbox" checked /><em>我已看过并同意<a href="#">《领投注册服务协议》</a></em></p>
                    </div>
                    <p class="release_btn_tj_box"><input type="button" value="提交" class="release_btn_tj" id="register_btn"></p>

                </form>
            </div>
        </div>
        <!--right-->
    </div>
<div class="cleardiv"></div>
</div>
<!--main-->
<!--footer-->
<div class="index_footer">
    <div class="index_footer_box">
        <div class="index_footer_box_left">
            <ul class="index_footer_box_nav">
                <li><a href="about_us.html" target="_blank">关于我们</a></li>
                <li><a href="#" target="_blank">帮助中心</a></li>
                <li><a href="#" target="_blank">合作伙伴</a></li>
                <li><a href="dynamic.html" target="_blank">新闻动态</a></li>
                <li><a href="#" target="_blank">服务条款</a></li>
                <li><a href="#" target="_blank">法律法规</a></li>
                <li><a href="#" target="_blank">风险揭示</a></li>
                <li><a href="" style="border:none;" target="_blank">隐私保护</a></li>
                <div class="cleardiv"></div>
            </ul>
            <ul class="index_footer_box_nav1">
                <li><a target="_blank">2015 领投 All rights reserved</a></li>
                <li><a target="_blank">杭州领投服务有限公司</a></li>
                <li><a style="border:none;">浙ICP备11455162号-6</a></li>
                <div class="cleardiv"></div>
            </ul>
        </div>

        <p class="index_wei"><img src="images/weixin.png" ></p>
    </div>
</div>
<!--footer-->
<!--mask-->
<div class="register_mask_box"></div>
<div class="register_mask_cont_box">
    <div class="register_mask_cont_title">
        <p><span>提示</span><a class="register_mask_close"><img src="images/mask_close_03.png"></a></p>
    </div>
    <div class="cleardiv"></div>
    <div class="register_mask_cont_cont">
        <!--<p>保存失败！</p>-->
        <!--<p><input type="submit" value="确定"/></p>-->
    </div>
</div>
<!--mask-->

<script>
    var register_dx=""
    $(document).ready(function(){
        $('#register_btn').click(function(){
            var register_phone=$("#register_phone").val();
            var register_yzm=$("#register_yzm").val();
            var register_dx_yzm=$("#register_dx_yzm").val();
            var register_password=$("#register_password").val();
            var register_passA=$("#register_passA").val();
            var register_tj_id=$("#register_tj_id").val();
            console.log('yes');
//            if(!register_dx_yzm){
//                alert("请填写短信验证码");
//                return false;
//            }
//            if(register_dx_yzm!==register_dx){
//                alert("短信验证码错误！");
//                return false;
//            }
           
            $.ajax({
                url:"lt/user/register",
                data:JSON.stringify({phone:register_phone,authCode:register_yzm,smsAuthCode:register_dx_yzm,password:register_password,inviterID:register_tj_id}),
                type:"POST",
                contentType: "application/json",
                dataType:"json",
                success:function(data){
                    if(data.result==1){
                       alert(data.resultMsg);
                    }else{
                        $(".register_mask_box").show();
                        $(".register_mask_cont_box").show();
                        $(".register_mask_cont_cont").append("<p>保存成功！</p><p><input type='submit' value='确定' class='register_mask_cont_cont_btn'/></p>");

                    }
                }
            });
        });
        $(".register_mask_cont_cont_btn").live("click",function(){
//            console.log(1)
            window.location="login.html";

        })
        $('#yanzhengPic').click(function (){
            var yanzhengPicSrc = $('#yanzhengPic').attr('src');
            $('#yanzhengPic').attr('src','lt/login_13.png?'+new Date().getTime())
            console.log(yanzhengPicSrc);
        });
        $('.new_fs').click(function (){
            var register_phone=$("#register_phone").val();
            $.ajax({
                url:"lt/user/getSmsAuthCode?mobile="+register_phone,
                data:"",
                type:"get",
                success:function(data){
                    if(data.result==1){
                        alert(data.resultMsg);
                    }else{
                        alert('验证码发送成功！请注意查收短信！');
                        register_dx=data.smsAuthCode;
                    }
                }
            });
        });
    })

</script>
</body>
</html>